/*
 * Copyright 2009 Vladimir Ritz Bossicard
 *
 * This file is part of OraDoc.
 *
 * OraDoc is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * Version     : $Revision: 23 $
 * Last edit   : $Date: 2009-05-29 11:58:29 +0000 (Fri, 29 May 2009) $
 * Last editor : $Author: vbossica $
 */
package org.oradoc;

import java.io.File;

/**
 * @author Vladimir Ritz Bossicard
 */
public class GeneratorCLI extends AbstractGeneratorApp {

    @Override
    protected void proceed(final String name, final String version, final String connection, final String username, final String password,
            final String outdir) throws Exception {

        Generator documenter = new Generator();
        documenter.setProperty("project.name", name);
        documenter.setProperty("project.version", version);
        documenter.setProperty("outdir", new File("target/test/html").getAbsolutePath());
        documenter.setProperty("oradoc.connection", connection);
        documenter.setProperty("oradoc.username", username);
        documenter.setProperty("oradoc.password", password);

        documenter.init("org.oradoc.config.DefaultConfiguration", new SysoutProcessListener());
        documenter.process();
    }

    @Override
    protected boolean areArgsRequired() {
        return true;
    }

    public static void main(final String[] args) {
        new GeneratorCLI().start(args);
    }

}